<?php
	$table = new swoole_table( 1024 );

	// 内存表增加列
	$table->column( 'id', $table::TYPE_INT, 4 );
	$table->column( 'name', $table::TYPE_STRING, 64 );
	$table->column( 'age', $table::TYPE_INT, 3 );
	$table->create();

	// 设/取值 两种方式
	//$table->set(
	//	'singwa_imooc',
	//	[ 'id' => 1, 'name' => singwa, 'age' => 30 ]
	//);
	
	$table[ 'singwa_imooc2' ] = [ 'id' => 2, 'name' => singwa2, 'age' => 20 ];


	//print_r( $table->get( 'singwa_imooc' ) );
	print_r( $table[ 'singwa_imooc2' ] );

	// 原子操作
	$table->incr( 'singwa_imooc2', 'age', 2 );
	$table->decr( 'singwa_imooc2', 'age', 1 );
	print_r( $table[ 'singwa_imooc2' ] );